// storePackage/pages/houseBindDetail/houseBindDetail.js
import { getHouseApplyList } from "../../../service/onetoone_service"
Page({

  /**
   * 页面的初始数据
   */
  data: {
    successImg: "https://jyhky.ylyc.top/shsuccess_icon.png",
    failImg: "https://jyhky.ylyc.top/shfail_icon.png",
    progressImg: "https://jyhky.ylyc.top/person%2Fbinding_icon.png",
    dataList: [

    ],

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() {
    this.getHouseApplyList();
  },
  getHouseApplyList() {
    wx.showLoading();
    getHouseApplyList().then(res => {
      console.log("JJLog:抵扣列表===:" + JSON.stringify(res));
      wx.hideLoading();
      if (res.code == 200) {
        this.setData({
          dataList: res.data
        })
      }
    }).catch(err => {
      wx.hideLoading();
      wx.showToast({
        title: err || "查询失败",
        icon: "none"
      })
      console.error("JJLog:getHouseApplyList", err);
    })
  },
  pushToBindHouse() {
    wx.navigateTo({
      url: '/shopMallPackage/pages/score/voucherHouseMoney/voucherHouseMoney',
    })
  },

  pushToImgs(e){
    let item = e.currentTarget.dataset.item;
    let arr = item.testimony || [];
    if(arr.length < 1){
       wx.showToast({
         title: '暂无成功凭证',
         icon:"none"
       })
       return;
    }
    let imgArr = [];
    arr.forEach((i)=>{
      imgArr.push(i.url)
    })
    wx.previewImage({
      urls: imgArr,
    })
  },






})